import service from '@/utils/request'
import { prefix } from '@/api/common'
import qs from 'qs'
export const usePostApi = (id: Number) => {
	return service.get(prefix + '/sys/post?id=' + id)
}

export const usePostNameListApi = (idList: number[]) => {
	return service.post(prefix + '/sys/post/nameList', idList)
}

export const usePostSubmitApi = (dataForm: any) => {
	return service.post(prefix + '/sys/post', dataForm)
}

export const usePostListApi = (data: any) => {
	return service.get(prefix + '/sys/post/page', {
		params: {
			page: data.page ? data.page : 1,
			limit: data.limit ? data.limit : 10
		},
		paramsSerializer: params => {
			return qs.stringify(params)
		}
	})
}
